<?php

require_once 'Zend/Db/Table/Abstract.php';

class Application_Model_Students extends Zend_Db_Table
{
    protected $_name = 'students';
    protected $_primary='id';
    
    public function changeimg($name,$headimg)
    {
    	$student = $this->fetchRow("`nickname`=\"$name\"")->toArray();
    	$data = array(
    			'headimg'=>$headimg
    	);
    	$studentid = $student['id'];
    	$this->update($data,"`id`=$studentid");
    }
}

